﻿<UserControl x:Class="uTorrentSL.Views.AddFilter"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             mc:Ignorable="d"
             DataContext="{Binding FiltersViewModel, Source={StaticResource Locator}}">
    <Grid>
        <Border Background="White" CornerRadius="9" BorderBrush="Black" BorderThickness="1">
            <Grid Margin="20">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="Name"/>
                <TextBox x:Name="tbName" Grid.Row="1" Grid.ColumnSpan="3" Width="300"/>
                <Button Content="Add" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding AddFilterCommand, Mode=OneWay}" CommandParameter="{Binding Text, ElementName=tbName}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
                <Button Content="Cancel" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding CloseModalCommand, Mode=OneWay, Source={StaticResource Locator}}" CommandParameter="{Binding Text, ElementName=AddUrl}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
            </Grid>
        </Border>
    </Grid>
</UserControl>
